#@layout()

#define js()
    <script>
    $(function(){
        var _table;
        _table =$("#fairorder-list").DataTable( {
            aLengthMenu:[10,20,50],
            "processing": true,
            "serverSide": true,
            "bLengthChange": false,
            "bSort":false,
            searching: false,//屏蔽datatales的查询框
            "pagingType":   "full_numbers",
            "ajax":{
                "url": "/admin/fairorder/listAll",
                "type": "post",
                "data": function (params) {
                        params["fairOrder.xml_content"]=$("#xml_content").val();
                        params["fairOrder.status"]=$("#status").val();
                }
            },
            "columns": [
                    { "data": "id" },
                    { "data":"order_desc"},
                    { "data": "order_no" },
                    { "data": "user" },
                    { "data": "status" },
                    { "data": "create_time" },
                    { "data": "trade_type" },
                    { "data": "opt_type" },
                    { "data": "total_fee" },
                { "data": function(data){
                    //var opt="<a href='javascript:;' onclick='edit("+data.id+")'>编辑</a>"+"|";
                    var opt="<a href='javascript:;' onclick='showdetail("+data.id+")'>查看详情</a>";
                     //opt+="<a href='javascript:;' onclick='del("+data.id+")'>删除</a>";
                    return opt;
                }
                }
            ]
        } );
        $("#searchBtn").click(function(){
            _table.ajax.reload();
        });
});
    /*编辑*/
    function edit(id){
        var title="编辑";
        var url="#(contextPath)/admin/fairorder/queryById?id="+id;
        var w="";
        var h=510;
        layer_show(title,url,w,h);
    }
    /*添加*/
    function add(){
        var title="添加";
        var url="#(contextPath)/admin/fairorder/add/";
        var w="";
        var h=510;
        layer_show(title,url,w,h);
    }

    /*删除*/
    function del(id){
        var config = {
        "url":"#(contextPath)/admin/fairorder/deleteById?id="+id,
        data:{}
        };
        var backendTool = new BackendTool(config);
        backendTool.ajaxRequest();
    }
    
    /*查看详情*/
    function showdetail(id){
        var title="查看详情";
        var url="/admin/fairorder/showDetail?id="+id;
        var w="";
        var h=510;
        layer_show(title,url,w,h);
    }
    </script>
#end

#define main()
    #@breadcrumb(["订单管理","订单列表"])
   <div class="page-container">
       <div class="text-c">
				<span class="select-box inline">
				<select name="fairOrder.status" class="select" id="status">
					<option value="-1">==请选择==</option>
					<option value="0">等待付款</option>
					<option value="1">已付款</option>
					<option value="2">已取消</option>
				</select> 
				</span>          
           <input type="text" name="" id="xml_content" placeholder="检索条件" style="width:350px" class="input-text">
           <button name="" id="searchBtn" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i>检索</button>
       </div>
       <div class="mt-20">
           <table class="table table-border table-bordered table-bg table-hover table-sort" id="fairorder-list">
               <thead>
               <tr class="text-c">
                     <th></th>
                     <th>支付描述</th>
                     <th>订单号</th>
                     <th>支付人</th>
                     <th>订单状态</th>
                     <th>创建时间</th>
                     <th>支付类型</th>
                     <th>充值类型</th>
                     <th>订单价格</th>
                   <th>操作</th>
               </tr>
               </thead>
               <tbody>
               </tbody>
           </table>
       </div>
   </div>
#end